import React, { Component } from 'react';

// import { Hello } from './Test';

export class NormalForm extends Component {
  // 原生DOM容器
  txtRef = React.createRef();
  txtRef2 = React.createRef();

  handleClick = (e) => {
    console.log(e.target);
    // target
    console.log(this.txtRef.current.value);
    this.txtRef.current.focus();
    // console.log(this.txtRef2.current);
    // console.log(this.txtRef2.current.setState({ hello: 'wahaha' }));
  };

  render() {
    return (
      <div>
        {/* <Hello ref={this.txtRef2} /> */}
        <input type={'text'} name="xxx" ref={this.txtRef} />
        <button onClick={this.handleClick}>提交</button>
      </div>
    );
  }
}
